#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <vector>
using namespace std;

int main()
{
    istream_iterator<double> is(cin), eos;
    ostream_iterator<double> os_vd(cout, " ");
    vector<double> vd(is, eos);
    copy(vd.begin(), vd.end(), os_vd);
    vector<int> vi(vd.begin(), vd.end());
    ostream_iterator<double> os_vd_vi(cout, "\n");
    for (int i = 0; i < vd.size(); i++)
    {
        cout << "( " << vd[i] << "," << vi[i] << " )" << endl;
    }
    cout << accumulate(vd.begin(), vd.end(), 0.0) << endl;
    cout << (accumulate(vd.begin(), vd.end(), 0.0) - accumulate(vi.begin(), vi.end(), 0.0));
    reverse(vd.begin(), vd.end());
    for (const auto &e : vd)
    {
        cout << e << ' ';
    }
    cout << endl;
    double vd_average = accumulate(vd.begin(), vd.end(), 0.0) / vd.size();
    cout << vd_average << endl;
    vector<double> vd2(vd.size());
    copy_if(vd.begin(), vd.end(), vd2.begin(), [vd_average](double d)
            { return d < vd_average; });

    return 0;
}